package cn.yll.api.order.service;

import cn.yll.api.order.request.OrderRequest;
import cn.yll.api.order.response.GoodResponse;
import cn.yll.common.module.PageModel;
import cn.yll.common.module.PageRequest;
import cn.yll.common.module.RestModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 商品相关接口服务
 * @author yangll
 */
@FeignClient(value = "shop-order", path = "/goods", contextId = "goodFeinService", fallbackFactory = RemoteGoodFeinServiceImpl.class)
public interface RemoteGoodFeinService {

    @PostMapping("/findGoodsByPage")
    RestModel<PageModel<GoodResponse>> findGoodsByPage(@RequestBody PageRequest request);

    @PostMapping("checkPriceAndReduceNum")
    @ApiOperation(value = "用户下单检查页面价格并扣减商品库存接口")
    RestModel<?> checkPriceAndReduceNum(@RequestBody OrderRequest request);
}
